package com.example.sample.Infrastructure.MybatisPlus;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.sample.domain.Entity.User;
import com.example.sample.domain.Entity.UserDept;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {

    @Select("SELECT u.id as userId,d.deptName,u.`name`,u.age,u.email,u.deptId FROM user u LEFT JOIN dept d on u.deptId=d.id")
    List<UserDept> UserDeptList();
}
